<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
    <style>
        .yz1, .yz2, .yz3, .yz4, .yz5, .yz6 {
            text-align: left !important;
            margin-left: 20px;
        }

        .yz1 :before, .yz2 :before, .yz3 :before, .yz4 :before, .yz5 :before, .yz6 :before {
            font-family: iconfont;
            font-style: inherit;
            padding: 0 5px;
            font-size: 14px;
            content: "\E60D";
        }
    </style>
</head>
<body>
<div id="app" class="setQuestion">
    <include file="./public/header.html"/>

    <div data-v-4ba25880="" class="container notSign fix pt15" s="[object Object]">
        <div data-v-4ba25880="" class="userMain mgb10 setQuestion">
            <ul data-v-4ba25880="" class="queue">
                <li data-v-4ba25880="" class="now"><span data-v-4ba25880="">验证密保问题</span><i data-v-4ba25880=""></i></li>
                <li><span>绑定密保问题</span><i></i></li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">完成</span><i data-v-4ba25880=""></i></li>
            </ul>
            <input type="hidden" name="id" id="uid" value="{$id}">
            <ul data-v-4ba25880="" class="submitContent mglr30 mgt15">
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题一：</span>
                    <select id="answer1" class="diyselect sb" style="width: 231px; height: 30px;">
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select> <span class="yz1" style="width: 300px"></span>
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案一：</span>
                    <input data-v-4ba25880="" name="answer1" id="yi" tag="答案一" placeholder="请输入答案" type="text"
                           class="userInput"> <span class="yz2" style="width: 300px"> </span><!---->
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题二：</span>
                    <select id="answer2" class="diyselect sb" style="width: 231px; height: 30px;">
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select><span class="yz3" style="width: 300px"></span>
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案二：</span>
                    <input data-v-4ba25880="" tag="答案二" name="answer2" id="er" placeholder="请输入答案" type="text"
                           class="userInput"><span class="yz4" style="width: 300px"></span> <!---->
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">问题三：</span>
                    <select id="answer3" class="diyselect sb" style="width: 231px; height: 30px;">
                        <foreach name="arr" item="v">
                            <option value="{$v.id}">{$v.content}</option>
                        </foreach>
                    </select><span class="yz5" style="width: 300px"></span>
                </li>
                <li data-v-4ba25880=""><span data-v-4ba25880="">答案三：</span>
                    <input data-v-4ba25880="" tag="答案三" name="answer3" id="san" placeholder="请输入答案" type="text"
                           class="userInput"> <span class="yz6" style="width: 300px"></span><!---->
                </li>

                <li data-v-4ba25880=""><span data-v-4ba25880=""></span>
                    <a data-v-4ba25880="" style="margin-left: 60px" class="submitBtn ClickShade" onclick="sav()">确定</a>
                </li>
            </ul>
        </div>
    </div>

    <include file="./public/footer.html"/>
</div>
<div id="layermbox232" class="layermbox layermbox0 layermshow" index="232">
    <div class="laymshade"></div>
    <div class="layermmain">
        <div class="section">
            <div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
                <button class="layermend"></button>
                <div class="layermcont">·密保问题答案错误·</div>
                <div class="layermbtn"><span type="1">确定</span></div>
            </div>
        </div>
    </div>
</div>

<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
    $(function () {
        personalInfo();
    })

    function sav() {
        var id = $("#uid").val();
        var question1 = $("#answer1").val();

        var question2 = $("#answer2").val();
        var question3 = $("#answer3").val();
        var answer1 = $("#yi").val();
        var answer2 = $("#er").val();
        var answer3 = $("#san").val();
        if (answer1 == '') {
            $(".yz2").html("<font color='red'>答案一不能为空</font>");
            return false;
        } else {
            $(".yz2").html("");
        }

        if (question2 == question1) {
            $(".yz3").html("<font color='red'>请选择其他密保问题进行验证</font>");
            return false;
        } else {
            $(".yz3").html("");
        }
        if (answer2 == '') {
            $(".yz4").html("<font color='red'>答案二不能为空</font>");
            return false;
        } else {
            $(".yz4").html("");
        }
        if (question3 == question2 || question3 == question1) {
            $(".yz5").html("<font color='red'>请选择其他密保问题进行验证</font>");
            return false;
        } else {
            $(".yz5").html("");
        }
        if (answer3 == '') {
            $(".yz6").html("<font color='red'>答案三不能为空</font>");
            return false;
        } else {
            $(".yz6").html("");
        }

        var data1 = {
            question1: question1,
            answer1: answer1,
        }

        var data2 = {
            question2: question2,
            answer2: answer2,
        }
        var data3 = {
            question3: question3,
            answer3: answer3,
        }

        $.ajax({
            type: "POST",
            url: "{:U('Users/setQuestion_upd')}",
            data: {'id': id, 'data1': data1, 'data2': data2, 'data3': data3},
            success: function (dat) {
                if (dat == 111) {
                    window.location.href="/Users/setverifyQuestion/id/"+id;
                } else {
                    $("#layermbox232").show();
                    return false;
                }
            }
        });


    }


</script>
</body>
</html>